
// 业务组件
import {markRaw} from 'vue'
import {v4 as uuidv4} from 'uuid';
import TitleEditor from '@/components/EditItems/TitleEditor.vue'
import DescEditor from '@/components/EditItems/DescEditor.vue'
import OptionsEditor from '@/components/EditItems/OptionsEditor.vue'
import PositionEditor from '@/components/EditItems/PositionEditor.vue'
import SizeEditor from '@/components/EditItems/SizeEditor.vue'
import WeightEditor from '@/components/EditItems/WeightEditor.vue'
import ItalicEditor from '@/components/EditItems/ItalicEditor.vue'
import ColorEditor from '@/components/EditItems/ColorEditor.vue'
import { EditorType, MaterialComType } from '@/constants'
import MultipleSelect from '@/components/Materials/SelectCom/MultipleSelect.vue'
import type { EditorComps} from '@/types'
export default function():EditorComps{
  return {
    id: uuidv4(),
    //类型
    type: markRaw(MultipleSelect),
    name: MaterialComType.MultiSelect,
    // 维护组件的状态 以此来影响组件
    status:{
      // 标题编辑器
      [EditorType.title]:{
        id: uuidv4(),
        status: '多选题默认标题!!!',
        isShow: true,
        name: 'title-edit',
        editCom: markRaw(TitleEditor)
      },
      // 详情编辑器
      [EditorType.desc]:{
        id: uuidv4(),
        status: '多选题默认详情!!!',
        isShow: true,
        name: 'desc-editor',
        editCom: markRaw(DescEditor)
      },
      // 选项
      [EditorType.options]:{
        id: uuidv4(),
        status: ['多选题默认选项1', '多选题默认选项2', '多选题默认选项3'],
        // 当前选中的选项
        currentStatus: 0,
        isShow: true,
        name: 'options-editor',
        editCom: markRaw(OptionsEditor)
      },
      // 位置
      [EditorType.position]:{
        id: uuidv4(),
        status: ['左对齐', '居中对齐'],
        currentStatus: 0,
        isShow: true,
        name: 'position-editor',
        editCom: markRaw(PositionEditor)
      },
      // 标题大小
      [EditorType.titleSize]:{
        id: uuidv4(),
        status: ['22', '20', '18'],
        currentStatus: 0,
        isShow: true,
        name: 'size-editor',
        editCom: markRaw(SizeEditor)
      },
      [EditorType.descSize]:{
        id: uuidv4(),
        currentStatus: 0,
        status: ['16', '14', '12'],
        isShow: true,
        name: 'size-editor',
        editCom: markRaw(SizeEditor),
      },
      [EditorType.titleWeight]:{
        id: uuidv4(),
        currentStatus: 1,
        status: ['加粗', '正常'],
        isShow: true,
        name: 'weight-editor',
        editCom: markRaw(WeightEditor),
      },
      [EditorType.descWeight]:{
        id: uuidv4(),
        currentStatus: 1,
        status: ['加粗', '正常'],
        isShow: true,
        name: 'weight-editor',
        editCom: markRaw(WeightEditor),
      },
      [EditorType.titleItalic]:{
        id: uuidv4(),
        currentStatus: 1,
        status: ['斜体', '正常'],
        isShow: true,
        name: 'italic-editor',
        editCom: markRaw(ItalicEditor),
      },
      [EditorType.descItalic]:{
        id: uuidv4(),
        currentStatus: 1,
        status: ['斜体', '正常'],
        isShow: true,
        name: 'italic-editor',
        editCom: markRaw(ItalicEditor),
      },
      [EditorType.titleColor]:{
        id: uuidv4(),
        status: '#000',
        isShow: true,
        name: 'color-editor',
        editCom: markRaw(ColorEditor),
      },
      [EditorType.descColor]:{
        id: uuidv4(),
        status: '#909399',
        isShow: true,
        name: 'color-editor',
        editCom: markRaw(ColorEditor),
      },
    }
  }
}
